*******************************************************************************
*** Paper: Populist Attitudes and Foreign Policy Postures
*** Tables EFA of foreign policy postures (Appendix)
********************************************************************************

*** PROGRAM SETUP COMMANDS
	set more off            // Disable partitioned output
	set dp period			// Use comma instead of dot for decimals
	clear all               // Start with a clean slate
	set linesize 80         // Line size limit to make output more readable
	macro drop _all         // clear all macros
	set scheme s1mono, permanent			// set graph scheme, e.g., cleanplots, plottig, plotplainblind, burd3, s1mono
	graph set window fontface "Times New Roman"				// set font in graphs | "Arial" | "Times New Roman"

************************************************************************************************************************************
************************************************************************************************************************************


*** Open data set
	capture use "Data_clean.dta", clear


*** EFA

*** Aggregate level
	factor mi_strongmil mi_preventagg mi_stopIOs mi_ownint /// as in Gravelle, mi_stopIOs and mi_ownint misbehave ---> DROP
		   ci_UN ci_allies ci_consensus ci_diplomacy /// 
		   iso_avoid iso_riskhappiness iso_mindown ///
		   gj_share gj_aid gj_enough
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  /// 
		   ci_UN ci_allies ci_consensus ci_diplomacy /// ci_allies has a different wording in Germany ---> DROP
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  /// 
		   ci_UN ci_consensus ci_diplomacy ///
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough
	rotate, promax blanks(.3)

	
*** Country specific
	*France
	factor mi_strongmil mi_preventagg  /// as in Gravelle, mi_stopIOs and mi_ownint misbehave ---> DROP
		   ci_UN ci_allies ci_consensus ci_diplomacy /// ci_allies has a different wording in Germany ---> DROP
		   iso_avoid iso_riskhappiness iso_mindown ///
		   gj_share gj_aid gj_enough if COUNTRY == 1
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  ///
		   ci_UN ci_consensus ci_diplomacy ///
		   iso_avoid iso_riskhappiness iso_mindown ///
		   gj_share gj_aid gj_enough if COUNTRY == 1
	rotate, promax blanks(.3)

	*Germany
	factor mi_strongmil mi_preventagg  /// as in Gravelle, mi_stopIOs and mi_ownint misbehave ---> DROP
		   ci_UN ci_allies ci_consensus ci_diplomacy /// ci_diplomacy's performance is scarce, but let's leave it in ci_allies has a different wording in Germany ---> DROP
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 2
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  /// 
		   ci_UN ci_consensus ci_diplomacy /// 
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 2
	rotate, promax blanks(.3)

	*UK
	factor mi_strongmil mi_preventagg  /// as in Gravelle, mi_stopIOs and mi_ownint misbehave ---> DROP
		   ci_UN ci_allies ci_consensus ci_diplomacy /// ci_diplomacy's performance is scarce, but let's leave it in ci_allies has a different wording in Germany ---> DROP
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 3
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  /// 
		   ci_UN ci_consensus ci_diplomacy /// 
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 3
	rotate, promax blanks(.3)

	*Italy
	factor mi_strongmil mi_preventagg  /// as in Gravelle, mi_stopIOs and mi_ownint misbehave ---> DROP
		   ci_UN ci_allies ci_consensus ci_diplomacy /// ci_diplomacy's performance is scarce, but let's leave it in ci_allies has a different wording in Germany ---> DROP
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 4
	rotate, promax blanks(.3)

	factor mi_strongmil mi_preventagg  /// 
		   ci_UN ci_consensus ci_diplomacy /// 
		   iso_avoid iso_riskhappiness iso_mindown /// 
		   gj_share gj_aid gj_enough if COUNTRY == 4
	rotate, promax blanks(.3)

	*** Correlations
	pwcorr *_index
	bysort COUNTRY: pwcorr *_index
